//
//  CYSelCategaryCollectionViewCell.m
//  cyydt
//
//  Created by chu on 2019/1/29.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYSelCategaryCollectionViewCell.h"

@implementation CYSelCategaryCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.titleBtn.layer.cornerRadius = 15;
    self.titleBtn.layer.masksToBounds = YES;
    
}

- (void)setModel:(CYCategrayModel *)model{
    _model = model;
    [self.titleBtn setTitle:model.catname forState:UIControlStateNormal];
    if ([model.isSelected boolValue]) {
        //选中
        self.titleBtn.layer.borderWidth = 0;
        [self.titleBtn setBackgroundColor:RGBOF(0xFF5353)];
        [self.titleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    }else{
        self.titleBtn.layer.borderWidth = 1;
        self.titleBtn.layer.borderColor = RGBOF(0xE3E3E3).CGColor;
        [self.titleBtn setBackgroundColor:[UIColor whiteColor]];
        [self.titleBtn setTitleColor:RGBOF(0x666666) forState:UIControlStateNormal];
    }
}

- (IBAction)selAction:(UIButton *)sender {
    if (self.block) {
        self.block();
    }
}

@end
